{template 'web/_header'}
<ul class="nav nav-tabs">
    <li class=""><a href="{php echo $this->createPluginWebUrl('express/express')}">快递预处理</a></li>
    <li class="active"><a href="{php echo $this->createPluginWebUrl('express/courier', array('op' => 'lists', 'expressid' => $_GPC['expressid']))}">快递单号管理</a></li>
    <li class=""><a href="{php echo $this->createPluginWebUrl('express/shipment')}">批量发货</a></li>
</ul>

<div class="panel panel-info">
    <div class="panel-heading">筛选</div>
    <div class="panel-body">

        <form action="./index.php" method="get" class="form-horizontal" role="form">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="ewei_shop" />
            <input type="hidden" name="do" value="plugin" />
            <input type="hidden" name="p"  value="express" />
            <input type="hidden" name="op" value="show" />
            <input type="hidden" name="method" value="courier" />
            <input type="hidden" name="id" value="{$_GPC['id']}" />
            <input type="hidden" name="expressid" value="{$_GPC['expressid']}" />

            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">单号</label>
                <div class="col-xs-12 col-sm-8 col-lg-9">
                    <input class="form-control" name="number" id="" type="text" value="{$_GPC['number']}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">状态</label>
                <div class="col-xs-12 col-sm-8 col-lg-8">
                    <select name="status" class='form-control'>
                        <option value="1" {if $_GPC['status'] != '0'} selected{/if}>使用</option>
                        <option value="0" {if $_GPC['status'] == '0'} selected{/if}>未使用</option>
                    </select>
                </div>

                <div class="col-xs-12 col-sm-2 col-lg-1">
                    <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                </div>
            </div>
        </form>
    </div>
</div>

<div class='panel panel-default'>
    <div class='panel-heading'>
        快递单号池设置
    </div>
    <div class='panel-body'>

        <table class="table">
            <thead>
                <tr>
                    <th>单号</th>
                    <th>使用状态</th>
                    <th>对应订单</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
            {loop $detailLists $list}
            <tr>
                <td>{$list['number']}</td>
                <td>{php echo empty($list['status']) ? '未使用' : '已使用'}</td>

                {if empty($list['orderid'])}
                <td>无</td>
                {else}
                <td><a href="{php echo $this->createWebUrl('order', array('op' => 'detail', 'id' => $list['orderid']))}">查看</a></td>
                {/if}
                <td>
                    {if !empty($list['orderid'])}
                    <a class='btn btn-default' title="取消发货" href="{php echo $this->createPluginWebUrl('express/courier', array('op' => 'show', 'id' => $list['id']))}" onclick="return confirm('是否取消此单号的发货？（原订单状态将会被修改成未发货状态）');return false;"><i class='fa fa-heart'></i></a>
                    {else}
                    <a class='btn btn-default' title="删除此单号" href="{php echo $this->createPluginWebUrl('express/courier', array('op' => 'delete', 'expressid' => $_GPC['expressid'], 'courierid' => $_GPC['id'], 'id' => $list['id']))}" onclick="return confirm('删除单号，可能会影响模块稳定性，请您确认？'); return false;"><i class='fa fa-close'></i></a>
                    {/if}
                </td>
            </tr>
            {/loop}
            </tbody>
        </table>
    </div>
    <div class='panel-footer'>
        {php echo $pagination}
    </div>
</div>


{template 'common/footer'}